<template>
 <div class="father">
   <Teleport to="body">
     <div class="son">盒子</div>
   </Teleport>
 </div>
</template>

<script>
export default {

}
</script>

<style lang="less" scoped>
.father{
  background-color: aquamarine;
  height: 500px;
  width: 500px;
  margin: 0 auto;
  transform: translate(0);
}
.son{
  width: 300px;
  height: 300px;
  background-color: pink;
  position: fixed;
  top: 0;
  left: 0;
}
</style>
